package com.cxso.example.request.sign;


import com.cxso.example.domain.sign.SignerInfoDomain;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

@Getter
@Setter
@Schema(description = "自动签署合同")
public class SignAutoSignRequest {


    @Schema(description = "签署人信息", example = "如果签署人前期没有申请证书，此时系统自动帮助用户申请证书，但是这样效率较差，建议前期帮助用户申请好证书")
    @NotNull(message = "签署人信息不能为空")
    @Valid
    private SignerInfoDomain signerInfo;


    @Schema(description = "合同编号")
    @NotBlank(message = "合同编号不能为空")
    private String contractNum;

    @Schema(description = "签署完成标志", example = "合同是否签署完成(0:是,1:否),例如合同属于双方合同，第一个人签署时，isFinish 否，当第二个签署时候，参数isFinish为是")
    @NotNull(message = "签署完成标志不能为空")
    private Integer isFinish;

    @Schema(description = "签章信息")
    @NotNull(message = "签章信息不能为空")
    @Valid
    private SignInfo signInfo;

    @Getter
    @Setter
    @Schema(description = "自动签署合同-签章信息-入参")
    public static class SignInfo {
        @Schema(description = "签章信息", example = "1签名 2印章")
        private String signType;

        @Schema(description = "签章或者签字ID", example = "如果不指定，则用户默认设置")
        private String signId;

        @Schema(description = "签章位置名称", example = "见模板中的设置，如果不指定，则用第一个位置")
        private String positionName;
    }
}
